﻿namespace TradePublish.Common
{
    using System;
    using System.Text;

    public class Util
    {
        public static readonly System.Random Random = new System.Random();

        public static string RandomNumeric(int length)
        {
            return RandomString(length, "0123456789");
        }

        private static string RandomString(int length, string allowedChars)
        {
            StringBuilder builder = new StringBuilder();
            for (int i = 0; i < length; i++)
            {
                builder.Append(allowedChars[Random.Next(1, allowedChars.Length)]);
            }
            return builder.ToString();
        }
    }
}

